<!DOCTYPE html>
<html>
<head>
    <title> {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head"/>
    <hook name="before_head_end"/>
    <style>
        .timeAdd {
            color: #9d9d9e;
            line-height: 20px;
            font-size: 13px;
            margin-top: 10px;
        }
    </style>
</head>
<body class="page-index">
<div class="container">
    <include file="public@nav"/>

    <php>
        $where= function($query){
        $query->where('post.create_time','egt',0);
        };
        $page=[
        'list_rows'=>10,
        'next'=>'下一页',
        'prev'=>'上一页'
        ];
    </php>
    <div class="contents">
        <!--活动通知/公告-->
        <div class="activity">
            <div class="title">
                <ul class="news-title">
                    <li class="title-item active  newTitle"><a href="javascript:;">最新公告</a></li>
                    <li class="title-item newTitle"><a href="javascript:;">志愿者新闻</a></li>
                    <li class="title-item newTitle"><a href="javascript:;">交通安全新闻</a></li>


                </ul>
            </div>
            <div class="box-cont">
                <div class="act-forenotice">
                    <div class="notice">
                        <portal:articles item="vo" where="$where" order="post.create_time DESC" page="$page"
                                         relation="categories"
                                         categoryIds="3"
                                         returnVarName="articles_data">

                            <div class="blockSty">
                                <a href="{:url('portal/New/detail',array('id'=>$vo['id']))}">
                                    <div>
                                        <img src="/html/img/list.png" class="listImg">
                                        <div class="blockTitle">{$vo.post_title}</div>
                                        <div style="clear: both;"></div>
                                    </div>
                                    <div class="timeAdd">
                                        <i class="layui-icon layui-icon-log"></i> {$vo.create_time|date="Y-m-d H:i"}
                                    </div>
                                </a>
                            </div>
                        </portal:articles>

                    </div>
                    <ul class="pagination">
                        <page/>
                    </ul>

                </div>
                <div class="act-forenotice  hidden">
                    <div class="notice">
                        <portal:articles item="vo" where="$where" order="post.create_time DESC" page="$page"
                                         relation="categories"
                                         categoryIds="1"
                                         returnVarName="articles_data">

                        <div class="blockSty">
                            <a href="{:url('portal/New/detail',array('id'=>$vo['id']))}">
                                <div>
                                    <img src="/html/img/list.png" class="listImg">
                                    <div class="blockTitle">{$vo.post_title}</div>
                                    <div style="clear: both;"></div>
                                </div>
                                <div class="timeAdd">
                                    <i class="layui-icon layui-icon-log"></i> {$vo.create_time|date="Y-m-d H:i"}
                                </div>
                            </a>
                        </div>
                        </portal:articles>

                    </div>
                    <ul class="pagination">
                        <page/>
                    </ul>

                </div>
                <div class="act-forenotice hidden">
                    <div class="notice">
                        <portal:articles item="vo" where="$where" order="post.create_time DESC" page="$page"
                                         relation="categories"
                                         categoryIds="2"
                                         returnVarName="articles_data">

                            <div class="blockSty">
                                <a href="{:url('portal/New/detail',array('id'=>$vo['id']))}">
                                    <div>
                                        <img src="/html/img/list.png" class="listImg">
                                        <div class="blockTitle">{$vo.post_title}</div>
                                        <div style="clear: both;"></div>
                                    </div>
                                    <div class="timeAdd">
                                        <i class="layui-icon layui-icon-log"></i> {$vo.create_time|date="Y-m-d H:i"}
                                    </div>
                                </a>
                            </div>
                        </portal:articles>


                    </div>

                    <ul class="pagination">
                        <page/>
                    </ul>

                    <!--<div id="listTwo"></div>-->
                </div>
            </div>
        </div>
        <div class="statistical">
            <widget name="last_articles">
            <div class="login box">
                <div class="title"><h2>最新公告</h2> <a href="" class="more newMore">MORE</a></div>
                <div class="box-cont hdtj zxgg">
                    <ul>
                        <portal:articles limit="5" order="post.published_time DESC"
                                         categoryIds="1,2,3,4">
                        <li>

                            <img src="/html/img/dian.png" class="dianImg">
                            <a href="{:url('portal/New/detail',array('id'=>$vo['id']))}">
                            {$vo.post_title}
                                </a>
                        </li>
                        </portal:articles>
                    </ul>
                </div>
            </div>
            </widget>
            <div class="rank box activeTime newActive">
                <widget name="hottest_articles">
                <div class="login box">
                    <div class="title"><h2>最多浏览</h2> <a href="" class="more newMore">MORE</a></div>
                    <div class="box-cont hdtj">
                        <php>
                            $hot_articles=[];
                        </php>
                        <ul>
                            <portal:articles limit="5" order="post.post_hits DESC"
                                             categoryIds="1,2,3,4">
                                <php>$top=$key<3?"top3":"";</php>
                            <li>

                                <img src="/html/img/dian.png" class="dianImg">
                                <a href="{:url('portal/New/detail',array('id'=>$vo['id']))}">
                                {$vo.post_title}
                                    </a>
                            </li>
                                </a>
                            </portal:articles>
                        </ul>
                    </div>
                </div>
                </widget>
            </div>
        </div>
        <div style="clear: both;"></div>
    </div>



    <include file="public@footer"/>
</div>

<include file="public@scripts"/>
<hook name="before_body_end"/>
</body>
<script>
    (function($){
        "use strict";
        function bind_events(){
            $('.title .title-item').off("click").on("click",function(e){
                e.preventDefault();
                var _index = $(this).index();
                $(this).addClass('active').siblings().removeClass('active');
                $('.activity .box-cont .act-forenotice').eq(_index).removeClass("hidden").siblings().addClass("hidden");
            });
            $('.tab-ctrl-item').off("click").on("click",function(e){
                e.preventDefault();
                var _index = $(this).index();
                $(this).addClass('active').siblings().removeClass('active');
                $('.rank .tab-pannel div').eq(_index).removeClass("hidden").siblings().addClass("hidden");
            });
        }
        $(function(){
            bind_events();
            $('.hdtj ul li:last').css("border","none");
            $('.zxgg ul li:last').css("border","none");
        })
    })(jQuery);

    //    layui
    layui.use(['laypage', 'layer'], function() {
        var laypage = layui.laypage
                , layer = layui.layer;
//        分页
        laypage.render({
            elem: 'listOne'
            ,count: 100
            ,layout: ['prev', 'page', 'next', 'skip' ,'count']
            ,prev: '<em>←</em>'
            ,next: '<em>→</em>'
            ,jump: function(obj){
                console.log(obj)
            }
        });
        laypage.render({
            elem: 'listTwo'
            ,count: 100
            ,layout: ['prev', 'page', 'next', 'skip' ,'count']
            ,prev: '<em>←</em>'
            ,next: '<em>→</em>'
            ,jump: function(obj){
                console.log(obj)
            }
        });
    });
</script>
</html>